package com.huawei.appmarket.service.settings.view.widget;

import android.app.Activity;
import android.os.Build.VERSION;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import com.huawei.appgallery.foundation.ui.framework.titleframe.bean.BaseTitleBean;
import com.huawei.appmarket.framework.titleframe.title.BackSearchbtnTitle;
import o.der.d;
import o.der.e;
import o.ewm.n;

public class GradeInfoTitle extends BackSearchbtnTitle {
    private ImageView ˋॱ;
    private MenuItem ˏॱ;
    private boolean ॱˊ;

    public GradeInfoTitle(Activity activity, BaseTitleBean baseTitleBean) {
        super(activity, baseTitleBean);
    }

    public View ʽ() {
        View ʽ = super.ʽ();
        if (this.ʻ != null) {
            this.ˋॱ = (ImageView) this.ʻ.findViewById(d.ᐧॱ);
            this.ˋॱ.setImageResource(e.ʽ);
            if (!this.ॱˊ) {
                this.ˋॱ.setVisibility(8);
            }
            this.ʻ.setContentDescription(this.ˋ.getResources().getString(n.יᐝ));
        }
        return ʽ;
    }

    public MenuItem ˎ(Menu menu) {
        this.ˏॱ = super.ˎ(menu);
        this.ˏॱ.setIcon(e.ʽ);
        if (VERSION.SDK_INT >= 26) {
            this.ˏॱ.setContentDescription(this.ˋ.getResources().getString(n.יᐝ));
        }
        if (!this.ॱˊ) {
            this.ˏॱ.setEnabled(false);
            this.ˏॱ.setVisible(false);
        }
        return this.ˏॱ;
    }

    public void ॱˋ() {
        this.ॱˊ = true;
        if (this.ˏॱ != null) {
            this.ˏॱ.setEnabled(true);
            this.ˏॱ.setVisible(true);
        }
        if (this.ˋॱ != null) {
            this.ˋॱ.setVisibility(0);
        }
    }

    public void ʻॱ() {
        this.ॱˊ = false;
        if (this.ˏॱ != null) {
            this.ˏॱ.setEnabled(false);
            this.ˏॱ.setVisible(false);
        }
        if (this.ˋॱ != null) {
            this.ˋॱ.setVisibility(8);
        }
    }
}
